//
//  SAWSetHomeworkTabCell.m
//  优学荟管理系统
//
//  Created by edz on 2018/1/26.
//  Copyright © 2018年 星道三好. All rights reserved.
//

#import "SAWSetHomeworkTabCell.h"

@implementation SAWSetHomeworkTabCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setUI];
        self.contentView.backgroundColor=RGBColor(245, 245, 245);
    }
    
    return self;
}
-(void)setUI
{
    UIView *backView = [[UIView alloc]init];
    [self.contentView addSubview:backView];
    backView.backgroundColor=[UIColor whiteColor];
    [backView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.offset(10);
        make.right.offset(-10);
        make.height.offset(70);
    }];
    
    _titLab =[[UILabel alloc]init];
    [backView addSubview:_titLab];
    [_titLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(15);
        make.top.offset(10);
    }];
    
    _numLab = [[UILabel alloc]init];
    [backView addSubview:_numLab];
    _numLab.textColor = [UIColor grayColor];
    _numLab.font = [UIFont systemFontOfSize:14];
    _numLab.text = [NSString stringWithFormat:@"共10题"];
    [_numLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(15);
        make.top.equalTo(_titLab.mas_bottom).offset(6);
    }];
    
    _selBtn = [[UIButton alloc]init];
    [backView addSubview:_selBtn];
    [_selBtn setFont:[UIFont systemFontOfSize:14]];
    [_selBtn setBackgroundImage:[UIImage imageNamed:@"btn_homework_choice_deleted"] forState:UIControlStateSelected];
    [_selBtn setTitle:@"选入" forState:0];
    
    [_selBtn setBackgroundImage:[UIImage imageNamed:@"btn_homework_choice_default"] forState:0];
    [_selBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-10);
        make.height.offset(30);
        make.top.offset(20);
        make.width.offset(83);
    }];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
